using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Windows.Navigation;

namespace WizardSample
{
    using System;
    using System.Windows;
    
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            /// InitializeComponent();

            runWizardButton_Click(null, null);

            this.Close();
        }
        
        void runWizardButton_Click(object sender, RoutedEventArgs e)
        {
            AuthenticationWizardData wizardData =
                new AuthenticationWizardData()
                    {
                        IISSiteList = new List<IISSiteData>()
                                          {
                                              new IISSiteData()
                                                  {
                                                      IISSiteId = 1,
                                                      IISSite = @"Default Web Site"
                                                  },
                                              new IISSiteData()
                                                  {
                                                      IISSiteId = 2,
                                                      IISSite = @"Internal Web Site"
                                                  }
                                          },
                        IISSiteItem = 2,    // 1 Based. i.e Default Web Site
                        AuthServiceVirtualPath = @"/Citrix/AuthServices",
                        FarmName = @"Farm1",
                        FarmPort = 8080,
                        FarmSSLRelayPort = 443,
                        FarmTransport = @"SSL Relay",
                        FarmServers = new ObservableCollection<String>()
                                          {
                                              @"CAMWGOTCHAL01",
                                              @"camwdevappweb",
                                              @"defaultfailover"
                                          }
                    };

            WizardDialog wizard = new WizardDialog(wizardData);

            wizard.AddPage(new WizardPageAuthFarm());
            wizard.AddPage(new WizardPageAuthSitePath());
            wizard.AddPage(new WizardPageAuthSummary());
            wizard.Start();
            wizard.WizardReturn += wizardReturn;

            Boolean? dialogResult = wizard.ShowDialog();

            if (dialogResult.Value)
            {
                // MessageBox.Show("Finished.");
            }
            else
            {
                // MessageBox.Show("Canceled.");
            }
        }

        private void wizardReturn(Object sender, ReturnEventArgs<WizardResult> e)
        {
        }
    }
}